<?php
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

/** @var \Magento\Cookie\Block\Html\Notices $block */
?>
<?php if ($this->helper(\Magento\Cookie\Helper\Cookie::class)->isUserNotAllowSaveCookie()): ?>
    <div role="alertdialog"
         tabindex="-1"
         class="message global cookie"
         id="notice-cookie-block"
         style="display: none;">
        <div role="document" class="content" tabindex="0">
            <p>
                <strong><?php echo $block->escapeHtml(__('We use cookies to make your experience better.')) ?></strong>
                <span><?php echo $block->escapeHtml(__('To comply with the new e-Privacy directive, we need to ask for your consent to set the cookies.')) ?></span>
                <?php echo $block->escapeHtml(__('<a href="%1">Learn more</a>.', $block->getPrivacyPolicyLink()), ['a']) ?>
            </p>
            <div class="actions">
                <button id="btn-cookie-allow" class="action allow primary">
                    <span><?php echo $block->escapeHtml(__('Allow Cookies')); ?></span>
                </button>
            </div>
        </div>
    </div>
    <script type="text/x-magento-init">
        {
            "#notice-cookie-block": {
                "cookieNotices": {
                    "cookieAllowButtonSelector": "#btn-cookie-allow",
                    "cookieName": "<?php /* @noEscape */ echo \Magento\Cookie\Helper\Cookie::IS_USER_ALLOWED_SAVE_COOKIE ?>",
                    "cookieValue": <?php /* @noEscape */ echo $this->helper(\Magento\Cookie\Helper\Cookie::class)->getAcceptedSaveCookiesWebsiteIds() ?>,
                    "cookieLifetime": <?php /* @noEscape */ echo $this->helper(\Magento\Cookie\Helper\Cookie::class)->getCookieRestrictionLifetime()?>,
                    "noCookiesUrl": "<?php echo $block->escapeJs($block->escapeUrl($block->getUrl('cookie/index/noCookies'))) ?>"
                }
            }
        }
    </script>
<?php endif; ?>
